using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

/// <summary>
/// UGUI outline 拓展
/// </summary>
public static class OutlineExtension 
{
    /// <summary>
    /// 设置文本颜色
    /// </summary>
    /// <param name="outline"></param>
    /// <param name="colorHtml">文字颜色 Html 码</param>
    public static void SetColor(this Outline outline, string colorHtml)
    {
        if (ColorUtility.TryParseHtmlString(colorHtml, out Color color))
        {
            outline.effectColor = color;
        }
    }

    /// <summary>
    /// 设置文本颜色
    /// </summary>
    /// <param name="outline"></param>
    /// <param name="color">文字颜色</param>
    public static void SetColor(this Outline outline, Color color)
    {
        outline.effectColor = color;
    }

}
